/**
 * 授权相关api
 */
import {
	http
} from '@/api/config.js'


/**
 * 微信登录
 */
export const toWxMpLogin = (param) => {
	return http.post('/user/wxMpLogin', {
		...param
	})
}


/**
 * 发送邮箱注册验证码
 */
export const sendRegisterEmailCaptcha = (param) => {
	return http.post('/user/register/email/captcha', {
		...param
	})
}

/**
 * 提交邮箱注册
 */
export const submitRegisterEmail = (param) => {
	return http.post('/user/register/email', {
		...param
	})
}

/**
 * 邮箱登录
 */
export const toEmailLogin = (param) => {
	return http.post('/user/login/email', {
		...param
	})
}


/**
 * 退出登录
 */
export const toLogout = (req) => {
	return http.post('/user/logout/').then((res => {}))
}

/**
 * 发送邮箱重置密码验证码
 */
export const sendResetPasswordEmailCaptcha = (param) => {
	return http.post('/user/resetPassword/email/captcha', {
		...param
	})
}

/**
 * 邮箱重置密码
 */
export const resetPasswordByEmail = (param) => {
	return http.post('/user/resetPassword/email', {
		...param
	})
}

/**
 * 更新密码
 */
export const resetPasswordByUser = (param) => {
	return http.post('/user/resetPassword/update', {
		...param
	})
}


/**
 * 发送邮箱绑定验证码
 */
export const sendBindEmailCaptcha = (param) => {
	return http.post('/user/bind/email/captcha', {
		...param
	})
}

/**
 * 邮箱绑定
 */
export const bindEmail = (param) => {
	return http.post('/user/bind/email', {
		...param
	})
}

/**
 * 发送邮箱解绑验证码
 */
export const sendUnbindEmailCaptcha = (param) => {
	return http.post('/user/unbind/email/captcha', {
		...param
	})
}

/**
 * 邮箱解绑
 */
export const unbindEmail = (param) => {
	return http.post('/user/unbind/email', {
		...param
	})
}